
import apiCaller from './ajax/ApiCaller'

class FrmFeService {

    getHeroState()
    {
        return apiCaller.call( {url:'auth/getState'})
    }

    getNew()
    {
        return apiCaller.call( {url:'ReportAndAction/getNew'})
    }
    getVersion()
    {
        return apiCaller.call( {url:'comet/getVersion'})
    }

    getUnhandled()
    {
        return apiCaller.call( {url:'ReportAndAction/getUnhandled'})
    }

    getHerosInCurrentRoom()
    {
        return apiCaller.call( {url:'Hero/getHerosByRoom'})
    }

    test()
    {
        return apiCaller.call({url:'auth/test' ,
        })
    }

    login(userCode,password)
    {
        return apiCaller.call({url:'auth/login' ,
        params: {
            userCode:userCode,
                password:password}
        })
    }
    acceptReport(id,operatorId){
        return apiCaller.call({url:'ReportAndAction/acceptReport' ,
            params: {
                reportId:id,
                operatorId:operatorId
        }
        })
    }
    delReport(id){
        return apiCaller.call({url:'ReportAndAction/deleteReportById' ,
            params: {
                reportId:id
            }
        })
    }

    handleReport(action)
    {
        return apiCaller.call({url:'ReportAndAction/handleReport' ,
            body: action

            ,method:'POST'
        })

    }
    queryActions(query)
    {
        return apiCaller.call({url:'ReportAndAction/getActions' ,
            body: query,
            method:'POST'
        })
    }
    queryReports(query)
    {
        return apiCaller.call({url:'ReportAndAction/getHandledReports' ,
            body: query,
            method:'POST'

        })
    }



}

export default new FrmFeService()